feat: addresses extended endpoint #368
Merged
+534
−115
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors
assets_stateto index CIP25 and CIP68 metadata separately instead of overwriting CIP25 metadata with CIP68 metadata. This fixes incorrect behavior in the/addresses/{address}/extendedendpoint, where thehas_nft_onchain_metadataflag failed to reflect cases where an asset carries both CIP25 and CIP68 metadata. The refactor also simplifies how metadata is processed and resolved.Related Issue(s)
#335
How was this tested?
cip25_existence_overrides_decimals()andcip68_decimals_are_extracted_when_no_cip25()unit tests inrest_blockfrost/handlers/addresses.rs.get_asset_info_resolves_user_token_metadata_from_reference_nft()andhandle_cip68_version_detection()unit tests inassets_state/src/state.rs./assets/{asset}and correct behavior for/addresses/{address}/extendedoutside of off-chain metadata differences.Note:
decimalscurrently differs from Blockfrost due to their off-chain registry dependency. Local indexing of the registry will be implemented in a future PR.Checklist
Impact / Side effects
CIP25 metadata is now stored independently rather than being overwritten by CIP68 metadata.
Reviewer notes / Areas to focus
Please focus review on
resolve_cip68_metadataandhandle_cip68_metadatainassets_state/src/state.rs.